//
//  VerticalButton.swift
//  许鲜
//
//  Created by hbl on 16/4/24.
//  Copyright © 2016年 hbl. All rights reserved.
//

import UIKit

class VerticalButton: UIButton {
    var model:CenterModel?
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        titleLabel?.textAlignment = NSTextAlignment.Center
        titleLabel?.font = UIFont.systemFontOfSize(12)
        
        
        imageView?.contentMode = UIViewContentMode.ScaleAspectFit
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        imageView?.frame = CGRectMake(-25, 0, frame.size.width + 50, frame.size.width)
        
        
        titleLabel?.frame = CGRectMake(0, CGRectGetMaxY((imageView?.frame)!), frame.size.width, frame.size.height - CGRectGetMaxY((imageView?.frame)!))
        titleLabel?.textColor = UIColor.grayColor()
        
        
    }
}
